import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:signage/l10n/l10n.dart';

class DialogUtils {
  static Future<bool> showConfirmDialog({
    String? title,
    required String content,
    String? cancelText,
    String? confirmText,
    BuildContext? context,
  }) async {
    final ctx = context ?? Get.context!;
    final result = await Get.dialog<bool>(
      AlertDialog(
        title: Text(title ?? AppLocalizations.of(ctx)!.translate('tips')),
        content: Text(content),
        actions: [
          TextButton(
            onPressed: () => Get.back(result: false),
            child: Text(cancelText ?? AppLocalizations.of(ctx)!.translate('cancel')),
          ),
          TextButton(
            onPressed: () => Get.back(result: true),
            child: Text(confirmText ?? AppLocalizations.of(ctx)!.translate('confirm')),
          ),
        ],
      ),
    );
    return result ?? false;
  }
} 